<template>
  <div>
    <el-tabs v-model="activeName" @tab-click='handleOpen'>
      <el-tab-pane label="管理员列表" name="changeAdmin">
      </el-tab-pane>
      <el-tab-pane label="添加管理员" name="addAdmin">
      </el-tab-pane>
    </el-tabs>
    <transition name="fadeChange" appear mode="out-in">
      <router-view></router-view>
    </transition>
  </div>
</template>
<script>
export default {
  data () {
    return {
      activeName: 'changeAdmin'
    }
  },
  methods: {
    handleOpen (target) {
      if (target.name === 'changeAdmin') {
        this.$router.push({ name: 'adminSet' })
      } else if (target.name === 'addAdmin') {
        this.$router.push({ name: 'adminAdd' })
      }
    }
  }
}
</script>
